
package com.xbongbong.admin.domain.entity;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.toolbox.wrap.Entity;
import com.xbongbong.pro.enums.raiders.enums.RaidersFreeEnum;
import com.xbongbong.pro.enums.raiders.enums.RaidersLockEnum;
import com.xbongbong.pro.enums.raiders.enums.RaidersRangeEnum;
import com.xbongbong.pro.enums.raiders.enums.RaidersStageEnum;
import com.xbongbong.pro.enums.raiders.enums.RaidersStarEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
* @author autoGen
* @time 2019-09-18 13:56:16
*/
@Getter
@Setter
@ToString
public class RaidersEntity extends Entity {

	private static final long serialVersionUID = 7613409726856262169L;

	public RaidersEntity() {
		del = 0;
		avgTime = 0;
	}
	//========== properties ==========

	/**
	* 主键
	*/
	private Long id;
	/**
	* 创建者id
	*/
	private String creatorId;
	/**
	* 创建时间时间戳
	*/
	private Long addTime;
	/**
	* 更新时间时间戳
	*/
	private Long updateTime;
	/**
	* 删除标记
	*/
	private Integer del;
	/**
	* 名称
	*/
	private String name;
	/**
	* 简介
	*/
	private String instruction;
	/**
	* 分组id
	*/
	private Long groupId;
	/**
	* 功能点 [{"businessType":{"parent":1,"child":4600},"title":"","instruction":"","url":""}]
	*/
	private JSONArray point;
	/**
	* 推荐程度（1推荐 2强烈推荐）
	*/
	private Integer star;
	/**
	* 解锁（1无需解锁2完成上一步解锁）
	*/
	private Integer lock;
	/**
	* 是否付费(1免费 2付费)
	*/
	private Integer free;
	/**
	* 价格（当收费的时候必填）
	*/
	private Double price;
	/**
	* 左侧html介绍
	*/
	private String html;
	/**
	* 角色权限:[1,2,3]，1员工，2主管，3超管
	*/
	private JSONArray permission;
	/**
	* 阶段(1.免费2.购买一个月3.购买三个月4.购买半年5.即将到期)
	*/
	private Integer stage;
	/**
	* 范围（1全部公司放开 2 私有，私有的只能出现在推荐分组里）
	*/
	private Integer range;
	/**
	* 功能预览 {"url":[],"score":2,"enable":1}
	*/
	private JSONObject preview;
	/**
	* 视频介绍 {"url":[],"score":2,"enable":0} （可关闭）
	*/
	private JSONObject video;
	/**
	* 实操使用(包含功能点){"score":2,"enable":0,"point":[{"saasMark":1,"businessType":4600,"name":"客户","title":"","instruction":"","url":""}]}
	*/
	private JSONObject operation;
	/**
	* 邀请同事（可关闭）
	*/
	private JSONObject invitation;
	/**
	* 总分(4项之和) 默认0
	*/
	private Integer totalScore;
	/**
	* 1待发布 （默认1）2.已发布
	*/
	private Integer publish;
	/**
	* 排序字段
	*/
	private Integer sort;
	/**
	* 平均耗时
	*/
	private Integer avgTime;
	/**
	 * 卡片样式配置[{"color":"#EA7F63","icon":"icon-customer","name":"客户"}]
	 */
	private JSONArray pointCard;
	/**
	 * 文档下载 {"url":[],"score":0,"enable":0,"title":"","button":"","summary":""}
	 */
	private JSONObject document;
	/**
	 * 镜像配置 {"mirrorId":1001,"mirrorName":"镜像Q","score":0,"enable":0,"title":"","button":"","summary":""}
	 */
	private JSONObject mirror;

	/**
	 * 初始化实体
	 * @param initPojoStr
	 * @author zcp
	 * @date 19/9/23 023 19:44
	 * @update 19/9/23 023 19:44
	 * @since v1.0
	 * @version v1.0
	 */
	public RaidersEntity(String initPojoStr) {
		id = null;
		name = "";
		instruction = "";
		point = new JSONArray();
		star = RaidersStarEnum.RECOMMEND.getCode();
		lock = RaidersLockEnum.FINISH_PRE_STEP.getCode();
		free = RaidersFreeEnum.FREE.getCode();
		price = 0D;
		permission = new JSONArray();
		stage = RaidersStageEnum.UN_LIMIT.getCode();
		range = RaidersRangeEnum.OWN_PUBLIC.getCode();
		preview = JSONObject.parseObject(initPojoStr);
		video = JSONObject.parseObject(initPojoStr);
		operation = JSONObject.parseObject(initPojoStr);
		invitation = JSONObject.parseObject(initPojoStr);
		del = 0;
		pointCard = new JSONArray();
		document = JSONObject.parseObject(initPojoStr);
		mirror = JSONObject.parseObject(initPojoStr);
	}
}

